#SVNVER = `svn info | grep Revision | awk '{print $$2}'`
TEMP   = readJsonFile

pathX86=./bin/x86/
pathARM=./bin/arm/
$(shell mkdir -p $(pathX86) $(pathARM))
CFLAGS =
ifdef ARM
	CC     = arm-linux-gnueabihf-gcc
	TARGET = $(TEMP)
	path   = $(pathARM)
	LIBRARY += ./armlibs/
	INCLUDE += ./include/
	DEBUG  = ARM
else
	CC     = gcc
	path   = $(pathX86)
	TARGET = $(TEMP)
	DEBUG  = x86
endif

ifdef _TEST
	CFLAGS+= -D_TEST
else
	CFLAGS+= 
endif

ifdef WARNING
	CFLAGS   += -Wall -g
else
	CFLAGS   +=  -g
endif


SRC       = ./src/*.c 
LIBS       = -lm

$(TARGET):$(SRC)
	$(CC) -D${DEBUG} $(CFLAGS) -o  $(path)$(TARGET) $(SRC)  $(LIBS) -L$(LIBRARY) -I$(INCLUDE)
.PHONY:clean
clean:
	-rm -rf $(pathX86)$(TARGET) $(pathARM)$(TARGET)

